#pragma once
#include "visual_data.h"
#include <QQueue>
#include <QPair>

class Camera;
class VisualRecognition;
class VisualSystem : public QObject
{
	Q_OBJECT
public:
	VisualSystem(QObject* parent);
	~VisualSystem();
	bool Init(const VisualInfo& info);

	bool StartSnap(int index = 0);
	VisualResult GetResult(int index = 0);
private slots:
	void OnCameraSnapfinish(int index);

	bool CreatePicturePath(const QString& path, const QString& ip);
signals:
	void VisualFinished(int index);
	void VisualSelfFinished(const QString& rgbfile);
private:
	int m_task = 0;
	QString m_id;
	QString m_savePath;
	VisualRecognition* m_recog = nullptr;
	Camera* m_camera = nullptr;

	QQueue<QPair<int, VisualResult>> m_result;
};
